<template>
  <div class="hezi">
    <div class="box">
      <img :src="goodlist.pic" alt="" />
      <div class="div">
        <p>{{ goodlist.name }}</p>
        <p>{{ goodlist.originalPrice }}</p>
        <el-row>
          <el-button type="primary" @click='$router.go(-1)'>返回列表</el-button>
          <el-button type="danger">加入购物车</el-button>
        </el-row>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "",
  data() {
    return {
      id: "",
      goodlist: {},
    };
  },
  mounted() {
    this.getgood();
  },
  methods: {
    getgood() {
      this.id = this.$route.query.id;
      this.$axios
        .post("https://api.it120.cc/small4/shop/goods/detail?id=" + this.id)
        .then((res) => {
          console.log(res.data);

          this.goodlist = res.data.basicInfo;
        });
    },
  },
  computed: {},
  watch: {},
};
</script>

<style lang='scss' scoped>
.hezi {
  width: 100%;
  display: flex;
  .box {
    width: 100%;
    margin-top: 20px;
    display: flex;
    img {
      height: 400px;
    }
    .div {
      margin-left: 30px;
    }
  }
}
</style>